import React from 'react';
import { BrowserRouter as Router, Routes, Route, useLocation } from 'react-router-dom';
import Navbar from './components/Navbar';
import RadiologistList from './components/RadiologistList';
import WorkloadPrediction from './components/WorkloadPrediction';
import Login from './components/Login';
import PrivateRoute from './components/PrivateRoute';
import EditRadiologist from './components/EditRadiologist';
import { AuthProvider } from './context/AuthContext';
import Timetable from './components/Timetable';
import Forecast from './components/Forecast';
import TrackLocation from './components/TrackLocation';

function App() {
  return (
    <AuthProvider>
      <Router>
        <Navbar />
        <TrackLocation />
        <div style={{ padding: '20px' }}>
          <Routes>
            <Route path="/login" element={<Login />} />
            <Route path="/radiologists" element={<PrivateRoute><RadiologistList /></PrivateRoute>} />
            <Route path="/radiologists/edit/:id" element={<PrivateRoute><EditRadiologist /></PrivateRoute>} />
            {/* <Route path="/schedule" element={<PrivateRoute><Schedule /></PrivateRoute>} /> */}
            <Route path="/schedule" element={<PrivateRoute><Timetable /></PrivateRoute>} />
            <Route path="/workload-prediction" element={<PrivateRoute><WorkloadPrediction /></PrivateRoute>} />
            <Route path="/forecast" element={<PrivateRoute><Forecast /></PrivateRoute>} />
          </Routes>
        </div>
      </Router>
    </AuthProvider>
  );
}

export default App;